package com.example.zy.car.view;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.example.zy.car.R;
import com.example.zy.car.base.BaseActivityWithTitleBar;

import java.text.SimpleDateFormat;
import java.util.Date;

public class NewEvaluateActivity extends BaseActivityWithTitleBar {
    private EditText mEdit_data,mEdit_number,mEdit_person;
    private Button mButton_create;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_new_evaluate);
        
        this.setLeftTitleTv("返回", new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
                overridePendingTransition(R.anim.extre_in,R.anim.extre_out);
            }
        });
        initView();
        initData();
        
    }

    private void initData() {
       
        mEdit_data.setText(getData());
        
        mButton_create.setOnClickListener(new View.OnClickListener() {
            
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(NewEvaluateActivity.this,EvaluateTypeActivity.class);
                Bundle bundle=new Bundle();
                bundle.putString("data",mEdit_data.getText().toString());
                bundle.putString("number",mEdit_number.getText().toString());
                intent.putExtra("lala",bundle);
                startActivity(intent);
                overridePendingTransition(R.anim.enter_in,R.anim.enter_out);
                finish();
            }
        });
    }
    

    private void initView() {
        mEdit_data= (EditText) findViewById(R.id.edit_newEvaluate_data);
        mEdit_number= (EditText) findViewById(R.id.edit_newEvaluate_number);
        mEdit_person= (EditText) findViewById(R.id.edit_newEvaluate_person);
        mButton_create= (Button) findViewById(R.id.bt_newEvaluate_createpg);
    }
    public String getData(){
        SimpleDateFormat formatter    =   new    SimpleDateFormat    ("yyyy-MM-dd");
        Date curDate    =   new    Date(System.currentTimeMillis());//获取当前时间    
        return formatter.format(curDate);
    }
}
